home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Core Concepts in Art 2
/
Core Concepts in Art (Frames of Reference)(The McGraw-Hill Companies)(2004).iso
/
mac
/
media
/
search.swf
/
scripts
/
frame_1
/
DoAction.as
< prev
Wrap
Text File
|
2003-10-12
|
4KB
|
182 lines
function createQuestionArray(whichChapter)
{
j = 1;
while(j <= this["chaptArray" + whichChapter].questionNum)
{
if(this["ch" + whichChapter] == undefined)
{
this["ch" + whichChapter] = new Array();
}
this["ch" + whichChapter].push(j);
j++;
}
chapterArray.push(this["ch" + whichChapter]);
if(chapterArray.length == _root.howManyChapters + 1)
{
createButtons();
}
}
function createButtons()
{
i = 0;
while(i < _root.howManyChapters)
{
duplicateMovieClip("chapter_mc","chaptBtn" + i,16384 + (100 + i));
if(_root.agreed == undefined)
{
this["chaptBtn" + i]._visible = 0;
}
else
{
this["chaptBtn" + i]._visible = 1;
}
this["chaptBtn" + i].highlight_mc._visible = 0;
if(i < 9)
{
this["chaptBtn" + i]._x = chapter_mc._x + 12 * i;
}
else
{
this["chaptBtn" + i]._x = chapter_mc._x - 64 + 20 * i;
}
if(i > 15)
{
this["chaptBtn" + i]._y = chapter_mc._y + 16;
this["chaptBtn" + i]._x -= 248;
}
if(i > 27)
{
this["chaptBtn" + i]._y = chapter_mc._y + 32;
this["chaptBtn" + i]._x -= 240;
}
var chapterColor = new Color(this["chaptBtn" + i].theChap);
chapterColor.setRGB(_root.restColor);
this["chaptBtn" + i].theNum = i + 1;
if(i < _root.dropChapters)
{
this["chaptBtn" + i].chap_btn._visible = 0;
this["chaptBtn" + i]._alpha = 30;
}
i++;
}
findStartChapter();
variableHolder_mc.firstTime = 1;
}
function processCaption(whichTitle)
{
var variables = new Array("title","artist","medium","date","location","dimensions");
captions.captionInfo = "";
i = 0;
while(i < variables.length)
{
if(this["vh" + whichTitle][variables[i]].length != 0)
{
captions.captionInfo = captions.captionInfo + this["vh" + whichTitle][variables[i]] + "\n";
}
i++;
}
}
function processArray()
{
i = 0;
while(i < _root.questionsWithImages.length)
{
_root.questionsWithImages[i].sort(sortNumerically);
j = 0;
while(j < _root.questionsWithImages[i].length)
{
if(_root.questionsWithImages[i][j] == _root.questionsWithImages[i][j + 1])
{
_root.questionsWithImages[i].splice(j + 1,1);
}
j++;
}
i++;
}
}
function sortNumerically(element1, element2)
{
return element1 - element2;
}
function findStartChapter()
{
i = 0;
while(i <= _root.howManyChapters)
{
if(chapterArray[i].length != 0)
{
theChapter = i;
doHighlight(i);
return undefined;
}
i++;
}
}
function doHighlight(whichToHighlight)
{
i = 0;
while(i <= _root.howManyChapters)
{
if(i == whichToHighlight)
{
this["chaptBtn" + (i - 1)].highlight_mc._visible = 1;
if(i > 9)
{
this["chaptBtn" + (i - 1)].highlight_mc._width = 20;
this["chaptBtn" + (i - 1)].highlight_mc._x = 4;
}
}
else
{
this["chaptBtn" + (i - 1)].highlight_mc._visible = 0;
}
i++;
}
}
function nextCard()
{
caption_txt.text = "";
variableHolder_mc.firstTime = 1;
}
function removeOldHolders()
{
i = 0;
while(i < chapterArray[theChapter].length)
{
removeMovieClip("vh" + i);
removeMovieClip(titlesHolder["titles" + i]);
i++;
}
}
function createHolders()
{
k = 0;
while(k < chapterArray[theChapter].length)
{
duplicateMovieClip("variableHolder_mc","vh" + k,16384 + (200 + k));
k++;
}
}
function findFilePath(theChap, theQuest, theTarget)
{
if(theChap < 10)
{
if(theQuest < 10)
{
loadVariables("txtFiles/Ch0" + theChap + "-0" + theQuest + ".txt",theTarget);
}
else
{
loadVariables("txtFiles/Ch0" + theChap + "-" + theQuest + ".txt",theTarget);
}
}
else if(theQuest < 10)
{
loadVariables("txtFiles/Ch" + theChap + "-0" + theQuest + ".txt",theTarget);
}
else
{
loadVariables("txtFiles/Ch" + theChap + "-" + theQuest + ".txt",theTarget);
}
}